#include <stdio.h>

void move_arr(int* arr, int sz)
{
	int left = 0;
	int right = sz - 1;

	while (left<right)
	{
		while ((left < right) && (arr[left] % 2 == 1))
		{
			left++;
		}
		while ((left < right) && (arr[right] % 2 == 0))
		{
			right--;
		}
		if (left < right)
		{
			int temp = arr[left];
			arr[left] = arr[right];
			arr[right] = temp;
			left++;
			right--;
		}
	}
	
}


int main()
{
	int arr[10]={0};
	int sz = sizeof(arr) / sizeof(arr[0]);
	for (int i = 0; i < sz; i++)
	{
		scanf_s("%d", &arr[i]);
	}

	move_arr(arr,sz);

	for (int i = 0; i < sz; i++)
	{
		printf("%d ", *(arr + i));
	}
	printf("\n");


	return 0;
}